home *** CD-ROM | disk | FTP | other *** search
- <!--- This example shows information available from datePart --->
-
- <HTML>
-
- <HEAD>
- <TITLE>
- DatePart Example
- </TITLE>
- </HEAD>
-
- <CFSET todayDate = #Now()#>
- <BASEFONT FACE="Arial, Helvetica" SIZE=2>
- <BODY bgcolor="#FFFFD5">
-
- <H3>DatePart Example</H3>
-
- <P>Today's date is <CFOUTPUT>#todayDate#</CFOUTPUT>.
-
- <P>Using datepart, we can extract an integer representing
- the various dateparts from that value
- <CFOUTPUT>
- <UL>
- <LI>year: #DatePart("yyyy", todayDate)#
- <LI>quarter: #DatePart("q", todayDate)#
- <LI>month: #DatePart("m", todayDate)#
- <LI>day of year: #DatePart("y", todayDate)#
- <LI>day: #DatePart("d", todayDate)#
- <LI>weekday: #DatePart("w", todayDate)#
- <LI>week: #DatePart("ww", todayDate)#
- <LI>hour: #DatePart("h", todayDate)#
- <LI>minute: #DatePart("n", todayDate)#
- <LI>second: #DatePart("s", todayDate)#
- </UL>
-
- </CFOUTPUT>
- </BODY>
-
- </HTML>
-